import dayjs from "dayjs"
import RelativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
// 添加插件
dayjs.extend(RelativeTime)

const fomatTime = (time: string) => {
  let a = dayjs(time)
  return dayjs(Date.now()).to(a, true)
}

export { fomatTime }